/**
 @file ctc_asw_vlan.h

 @author  Copyright (C) 2020 Centec Networks Inc.  All rights reserved.

 @date 2020-07-18

 @version v1.0

 This module provides basic vlan/vlan-class/vlan-mapping/vlan-range functions.
 \d Basic vlan
 \d Vlan classification
 \d Vlan mapping

 \b
 \B Basic vlan
 \p
Basic VLAN configuration allows for the creation and destruction of 802.1Q VLAN definitions. This allows for
binding an 802.1Q VLAN ID to a set of ports and managing the member ports. The API maintains
consistency between trunking, VLAN configuration and port-based VLAN configuration.
The Module support convenient way to create vlan by ctc_vlan_create_uservlan(), fid will be the value you set.

 \b
 \B Vlan classfication
 \p
 The VLAN APIs can support vlan class by:
 \pp
 \dd    mac--macsa or macda;
 \dd    ip--ipv4sa or ipv6sa;
 \dd    protocol--ether-type;
 \pp
 Vlan classification priority: mac/protocal(use-flex) > mac/ipv4/ipv6(hash).
 \b
 \pp
 Vlan class function refer to ctc_vlan_add_vlan_class() and ctc_vlan_remove_vlan_class().
 \pp
 And it can configure default vlan class action if mismatch any entry by API ctc_vlan_add_default_vlan_class().

 \b
 \B Vlan mapping
 \p
 VLAN APIs can support vlan mapping in direction ingress or egress.
 Ingress vlan mapping support the following application:
 \pp
 \dd    QinQ
 \dd    vlan translation
 \dd    vlan stacking
 \dd    vlan switching
 \pp
 The ingress vlan mapping function refer to APIs ctc_vlan_add_vlan_mapping() and ctc_vlan_update_vlan_mapping(), ctc_vlan_remove_vlan_mapping().
 \pp
 \b
 \pp
 VLAN APIs can support vlan tag(s or c) /vlan id /cos action type in ingress vlan mapping as following:
 \p
 \t  |   stag action(svid:scos)  |     NONE    |  REP_OR_ADD |     APPEND   |     DEL     |
 \t  |----------------|-------------|-------------|------------- |-------------|
 \t  |    none:none   |      1      |      1      |       1      |      1      |
 \t  |----------------|-------------|-------------|------------- |-------------|
 \t  |    none:swap   |      0      |      1      |       1      |      0      |
 \t  |----------------|-------------|-------------|------------- |-------------|
 \t  |    none:new    |      0      |      1      |       1      |      0      |
 \t  |----------------|-------------|-------------|------------- |-------------|
 \t  |  none:default  |      0      |      1      |       1      |      0      |
 \t  |----------------|-------------|-------------|------------- |-------------|
 \t  |    swap:none   |      0      |      1      |       1      |      0      |
 \t  |----------------|-------------|-------------|------------- |-------------|
 \t  |    swap:swap   |      0      |      1      |       1      |      0      |
 \t  |----------------|-------------|-------------|------------- |-------------|
 \t  |    swap:new    |      0      |      1      |       1      |      0      |
 \t  |----------------|-------------|-------------|------------- |-------------|
 \t  |  swap:default  |      0      |      1      |       1      |      0      |
 \t  |----------------|-------------|-------------|------------- |-------------|
 \t  |     new:none   |      0      |      1      |       1      |      0      |
 \t  |----------------|-------------|-------------|------------- |-------------|
 \t  |     new:swap   |      0      |      1      |       1      |      0      |
 \t  |----------------|-------------|-------------|------------- |-------------|
 \t  |     new:new    |      0      |      1      |       1      |      0      |
 \t  |----------------|-------------|-------------|------------- |-------------|
 \t  |   new:default  |      0      |      1      |       1      |      0      |
 \t  |----------------|-------------|-------------|------------- |-------------|
 \t  |  default:none  |      0      |      1      |       1      |      0      |
 \t  |----------------|-------------|-------------|------------- |-------------|
 \t  |  default:swap  |      0      |      1      |       1      |      0      |
 \t  |----------------|-------------|-------------|------------- |-------------|
 \t  |  default:new   |      0      |      1      |       1      |      0      |
 \t  |----------------|-------------|-------------|------------- |-------------|
 \t  |default:default |      0      |      1      |       1      |      0      |
 \p
 \p
 \t  |   ctag action(cvid:ccos)  |     NONE    |  REP_OR_ADD |     APPEND   |     DEL     |
 \t  |----------------|-------------|-------------|------------- |-------------|
 \t  |    none:none   |      1      |      1      |       1      |      1      |
 \t  |----------------|-------------|-------------|------------- |-------------|
 \t  |    none:swap   |      0      |      1      |       1      |      0      |
 \t  |----------------|-------------|-------------|------------- |-------------|
 \t  |    none:new    |      0      |      1      |       1      |      0      |
 \t  |----------------|-------------|-------------|------------- |-------------|
 \t  |  none:default  |      0      |      1      |       1      |      0      |
 \t  |----------------|-------------|-------------|------------- |-------------|
 \t  |    swap:none   |      0      |      1      |       1      |      0      |
 \t  |----------------|-------------|-------------|------------- |-------------|
 \t  |    swap:swap   |      0      |      1      |       1      |      0      |
 \t  |----------------|-------------|-------------|------------- |-------------|
 \t  |    swap:new    |      0      |      1      |       1      |      0      |
 \t  |----------------|-------------|-------------|------------- |-------------|
 \t  |  swap:default  |      0      |      1      |       1      |      0      |
 \t  |----------------|-------------|-------------|------------- |-------------|
 \t  |     new:none   |      0      |      1      |       1      |      0      |
 \t  |----------------|-------------|-------------|------------- |-------------|
 \t  |     new:swap   |      0      |      1      |       1      |      0      |
 \t  |----------------|-------------|-------------|------------- |-------------|
 \t  |     new:new    |      0      |      1      |       1      |      0      |
 \t  |----------------|-------------|-------------|------------- |-------------|
 \t  |   new:default  |      0      |      1      |       1      |      0      |
 \t  |----------------|-------------|-------------|------------- |-------------|
 \t  |  default:none  |      0      |      1      |       1      |      0      |
 \t  |----------------|-------------|-------------|------------- |-------------|
 \t  |  default:swap  |      0      |      1      |       1      |      0      |
 \t  |----------------|-------------|-------------|------------- |-------------|
 \t  |  default:new   |      0      |      1      |       1      |      0      |
 \t  |----------------|-------------|-------------|------------- |-------------|
 \t  |default:default |      0      |      1      |       1      |      0      |
 \b
 \pp

\S ctc_vlan.h:ctc_vlan_class_type_t
\S ctc_vlan.h:ctc_vlan_class_t
\S ctc_vlan.h:ctc_vlan_mapping_key_t
\S ctc_vlan.h:ctc_vlan_mapping_t
*/

#ifndef _CTC_ASW_VLAN_H
#define _CTC_ASW_VLAN_H
#ifdef __cplusplus
extern "C" {
#endif

#include "ctc_vlan.h"
#define CTC_VLAN_HASH_AD_BASE   0           /**< [TMA] 0~255 used for hash(total 256)*/
#define CTC_VLAN_TCAM_AD_BASE   256         /**< [TMA] 256~271 used for cam(total 16)*/
#define CTC_VLAN_PORT_AD_BASE   269         /**< [TMA] ivm_table 269~298 used for port(total 29)*/

enum ctc_asw_vlan_property_e
{
    CTC_VLAN_INT_PROP_TPID_INDEX,           /**< [TMA] ivm_table storm ctl tpid index*/
    CTC_VLAN_INT_PROP_VLAN_STORM_CTL_PTR,   /**< [TMA] ivm_table storm ctl index*/
    CTC_VLAN_INT_PROP_VLAN_STORM_CTL_EN,    /**< [TMA] ivm_table storm ctl enable*/
    CTC_VLAN_PROP_MAX,
};
typedef enum ctc_asw_vlan_property_e  ctc_asw_vlan_property_t;

/**********************************************************************************
                      Define API function interfaces
***********************************************************************************/
/**
 @brief Init the vlan module

 @param[in] lchip    local chip id

 @param[in] vlan_global_cfg         vlan module global config

 @remark[TMA]
        Initialize device tables and driver structures for VLAN management functions:
        \p
        (1)Basic vlan
        \p
        (2)Adv-vlan: vlan class and vlan mapping.
        \p
        By default, all vlan transmit and receive is disable except vlan 0.
        Arp packet and dhcp packet is forward.

 @return CTC_E_XXX

*/
extern int32
ctc_asw_vlan_init(uint8 lchip, ctc_vlan_global_cfg_t* vlan_global_cfg);

/**
 @brief De-Initialize vlan module

 @param[in] lchip    local chip id

 @remark[TMA]  User can de-initialize the vlan configuration

 @return CTC_E_XXX
*/
extern int32
ctc_asw_vlan_deinit(uint8 lchip);

/**
 @brief  Create a user vlan

 @param[in] lchip    local chip id

 @param[in] user_vlan         user vlan info

 @remark[TMA]
        Allocate and configure a VLAN on the Centec device in vlanptr_mode = CTC_VLANPTR_MODE_USER_DEFINE1.
        Create a new VLAN with the given vlan_id, given vlanptr and given fid(vsi).
        By default, transmit and receive of this vlan is enable.
        Arp packet and dhcp packet is forward.
        0~127 port is tagged for this VLAN.
        L2 flooding entry added by default, fid is l2mc group id.

 @return CTC_E_XXX

*/
extern int32
ctc_asw_vlan_create_uservlan(uint8 lchip, ctc_vlan_uservlan_t* user_vlan);
/**
 @brief  Remove the vlan

 @param[in] lchip    local chip id

 @param[in] vlan_id         802.1q vlan id

 @remark[TMA]
        To deallocate the VLAN previously created, API ctc_vlan_destroy_vlan must be used.
        By default, this vlan transmit and receive is disable.
        Arp packet and dhcp packet is forward.

 @return CTC_E_XXX

*/
extern int32
ctc_asw_vlan_destroy_vlan(uint8 lchip, uint16 vlan_id);

/**
 @brief  Add member ports to a vlan

 @param[in] lchip_id    local chip id

 @param[in] vlan_id         802.1q vlan id

 @param[in] port_bitmap     bits map of port in vlan

 @remark[TMA]
        Adds the selected ports to the VLAN. At the same time allow vlan on the specify port.

 @return CTC_E_XXX
*/
extern int32
ctc_asw_vlan_add_ports(uint8 lchip_id, uint16 vlan_id, ctc_port_bitmap_t port_bitmap);
/**
 @brief  Show vlan's member port

 @param[in] lchip    local chip id

 @param[in] vlan_id         802.1q vlan id

 @param[in] gchip         global chip id

 @param[out] port_bitmap    bits map of port in vlan

 @remark[TMA]
        Get info about whether ports are added in the given vlan_id VLAN.
        *port_bitmap is the bitmap of 0~127 port in this vlan_id.
        If the bit of the port is set, it means that the port is added in the vlan;
        otherwise, the port is not added.

 @return CTC_E_XXX

*/
extern int32
ctc_asw_vlan_get_ports(uint8 lchip, uint16 vlan_id, uint8 gchip, ctc_port_bitmap_t port_bitmap);
/**
 @brief  Remove member ports from a vlan

 @param[in] lchip_id    local chip id

 @param[in] vlan_id         802.1q vlan id

 @param[in] port_bitmap          bits map of port in vlan

 @remark[TMA]
        Removes the specified ports from the given VLAN. If the requested ports is not already
        members of the VLAN, the routine returns CTC_E_MEMBER_PORT_NOT_EXIST.

 @return CTC_E_XXX
*/
extern int32
ctc_asw_vlan_remove_ports(uint8 lchip_id, uint16 vlan_id, ctc_port_bitmap_t port_bitmap);
/**
 @brief  Set various properties of the vlan

 @param[in] lchip    local chip id

 @param[in] vlan_id         802.1q vlan id/user_vlanptr

 @param[in] vlan_prop       vlan property

 @param[in] value           value need set

 @remark[D2.TM.TMM]
        The parameter vlan_id is vlanid in vlanptr_mode = CTC_VLANPTR_MODE_VLANID;
        \p
        The parameter vlan_id is vlanptr in vlanptr_mode = CTC_VLANPTR_MODE_USER_DEFINE1.
        \p
        Set property configuration as enum ctc_vlan_property_t with the uint32 value in the VLAN given.
        \p
        vlan_prop:
        \d CTC_VLAN_PROP_FID:                       fid for general l2 bridge, VSIID for L2VPN.
        \d CTC_VLAN_PROP_DROP_UNKNOWN_UCAST_EN:     vlan drop unknown ucast packet enable.
        \d CTC_VLAN_PROP_DROP_UNKNOWN_MCAST_EN:     vlan drop unknown mcast packet enable.
        \d CTC_VLAN_PROP_DROP_UNKNOWN_BCAST_EN:     vlan drop unknown bcast packet enable.
        \p
        When a vlan is created, by default, unknown ucast packet, unknown mcast packet and unknown bcast packet forwarding with this vlan_id is not to dropped.

 @return CTC_E_XXX
*/
extern int32
ctc_asw_vlan_set_property(uint8 lchip, uint16 vlan_id, ctc_vlan_property_t vlan_prop, uint32 value);
/**
 @brief  Get various properties of the vlan

 @param[in] lchip    local chip id

 @param[in] vlan_id         802.1q vlan id/user_vlanptr

 @param[in] vlan_prop       vlan property

 @param[out] value           value need get

 @remark[TMA]
        Get info about property configuration of this vlan.

 @return CTC_E_XXX
*/
extern int32
ctc_asw_vlan_get_property(uint8 lchip, uint16 vlan_id, ctc_vlan_property_t vlan_prop, uint32* value);
/**
 @brief  Set tagged ports on vlan

 @param[in] lchip_id    local chip id

 @param[in] vlan_id         802.1q vlan id

 @param[in] port_bitmap          bits map of port in vlan

 @remark[TMA]
   Set whether the vlan is tagged or not when output from the specify port, mainly used on hyrpid port

 @return CTC_E_XXX

*/
extern int32
ctc_asw_vlan_set_tagged_ports(uint8 lchip_id, uint16 vlan_id, ctc_port_bitmap_t port_bitmap);
/**
 @brief  Get tagged port on vlan

 @param[in] lchip    local chip id

 @param[in] vlan_id         802.1q vlan id

 @param[in] gchip         global chip id

 @param[out] port_bitmap     Bitmap of port tagged or not in this vlan

 @remark[TMA]
        Get the ports from which vlan is tagged or not.

 @return CTC_E_XXX

*/
extern int32
ctc_asw_vlan_get_tagged_ports(uint8 lchip, uint16 vlan_id, uint8 gchip, ctc_port_bitmap_t port_bitmap);

/**
 @brief  Add one vlan mapping entry on the port in IPE

 @param[in] lchip    local chip id

 @param[in] gport           Global phyical port of system

 @param[in] p_vlan_mapping  Vlan mapping info, include key and mapped action

 @remark[TMA]
       Configure ingress vlan mapping on gport, expecting packet received from this gport(with some special vid or vrange_grpid or cos or not) to do special action
       Key type(any combination) will be the mapping key, see key in struct ctc_vlan_mapping_t.
       If not using cvid/svid/scos/ccos as key, CTC_VLAN_MAPPING_KEY_NONE will be set(only source port as key).
       If any entry is matched, it will do the action as action in struct ctc_vlan_mapping_t.
       \p
       Except the key and action you must set, you must configure as follow:
       \p
       1. Stag_op(stag special action) & ctag_op(ctag special action) will be set configuration to stag & ctag, seeing enum ctc_vlan_tag_op_t.
       \p
       2. Svid_sl(svid special action) & scos_sl(scos special action) & cvid_sl(cvid special action) & ccos_sl(ccos special action)  will be set configuration to
       svlan id, scos, cvlan id, ccos, seeing enum ctc_vlan_tag_sl_t.
       \p
       \b
       For example:
       \p
       Ingress vlan translation(for example:s+c->s'+c'):
       \d (1)stag_op:CTC_VLAN_TAG_OP_REP_OR_ADD;
       \d (2)ctag_op:CTC_VLAN_TAG_OP_REP_OR_ADD;
       \d (3)svid_sl:CTC_VLAN_TAG_SL_NEW;
       \d (4)cvid_sl:CTC_VLAN_TAG_SL_NEW;
       \p
       QinQ(c->c+s):
       \d (1)stag_op:CTC_VLAN_TAG_OP_REP_OR_ADD
       \d (2)svid_sl:CTC_VLAN_TAG_SL_NEW, new svid must be configured (if having no svid, 0 is used);
       \p
       Vlan stacking(s->s+s'):
       \d (1)stag_op:CTC_VLAN_TAG_OP_ADD;
       \d (2)svid_sl:CTC_VLAN_TAG_SL_NEW, new svid must be configured (if having no svid, 0 is used);

 @return CTC_E_XXX
*/
extern int32
ctc_asw_vlan_add_vlan_mapping(uint8 lchip, uint32 gport, ctc_vlan_mapping_t* p_vlan_mapping);

/**
 @brief  Get one vlan mapping entry

 @param[in] lchip    local chip id

 @param[in] gport           Global phyical port of system

 @param[in] p_vlan_mapping  Vlan mapping info

 @remark[TMA]
       Get one vlan mapping entry based on the given key.

 @return CTC_E_XXX
*/
extern int32
ctc_asw_vlan_get_vlan_mapping(uint8 lchip, uint32 gport, ctc_vlan_mapping_t* p_vlan_mapping);

/**
 @brief  Update one vlan mapping entry on the port in IPE

 @param[in] lchip    local chip id

 @param[in] gport           Global phyical port of system

 @param[in] p_vlan_mapping  Vlan mapping info

 @remark[TMA]
       Update configuration ingress vlan mapping on gport.
       How to use it is the same as API ctc_vlan_add_vlan_mapping().


 @return CTC_E_XXX
*/
extern int32
ctc_asw_vlan_update_vlan_mapping(uint8 lchip, uint32 gport, ctc_vlan_mapping_t* p_vlan_mapping);
/**
 @brief  Remove one vlan mapping entry on the port in IPE

 @param[in] lchip    local chip id

 @param[in] gport           Global phyical port of system

 @param[in] p_vlan_mapping  Vlan mapping info, include key info to be deleted

 @remark[TMA]
       Delete configuration ingress vlan mapping on gport(with some special vid or vrange_grpid or cos or not).
       Key type(any combination) will be the mapping key, see key in struct ctc_vlan_mapping_t.
       If not using cvid/svid/scos/ccos as key, CTC_VLAN_MAPPING_KEY_NONE will be set(only source port as key).
       If any entry is matched, it will do the action as action in struct ctc_vlan_mapping_t.

 @return CTC_E_XXX
*/
extern int32
ctc_asw_vlan_remove_vlan_mapping(uint8 lchip, uint32 gport, ctc_vlan_mapping_t* p_vlan_mapping);

/**
 @brief  Create a vlan range

 @param[in] lchip    local chip id

 @param[in] vrange_info   vlan range info

 @param[in] is_svlan      vlan range used for svlan

 @remark[TMA]
      Create vlan range group including three element: vrange_grpid, direction (see struct ctc_vlan_range_info_t) and is_svlan.
      is_svlan denote whether the vlan range group property svlan or cvlan.

 @return CTC_E_XXX
*/
extern int32
ctc_asw_vlan_create_vlan_range_group(uint8 lchip, ctc_vlan_range_info_t* vrange_info, bool is_svlan);

/**
 @brief  Get vlan range type

 @param[in] lchip    local chip id

 @param[in] vrange_info   vlan range info

 @param[out] is_svlan      vlan range used for svlan

 @remark[TMA]
     Get info about whether the vlan range group is svlan or not, according to two elements: vrange_grpid and direction of the vlan range group.

 @return CTC_E_XXX
*/
extern int32
ctc_asw_vlan_get_vlan_range_type(uint8 lchip, ctc_vlan_range_info_t* vrange_info, bool* is_svlan);

/**
 @brief  Delete a vlan range

 @param[in] lchip    local chip id

 @param[in] vrange_info   vlan range info

 @remark[TMA]
     Delete vlan range group with two element: vrange_grpid and direction.
     Then 8 entries in that vlan range group will be reset.

 @return CTC_E_XXX
*/
extern int32
ctc_asw_vlan_destroy_vlan_range_group(uint8 lchip, ctc_vlan_range_info_t* vrange_info);

/**
 @brief  Add a vlan range member to a vrange_group

 @param[in] lchip    local chip id

 @param[in] vrange_info   vlan range info

 @param[in] vlan_range    vlan_start and vlan_end in vlan range

 @remark[TMA]
      Add vlan range entry member into one vlan range group, according to vrange_grpid & direction of the vlan range group.
      \p
      Note: 1. vlan range group must be create before this, or will reply error.
      \p
            2. one vlan range group only can have 8 vlan range members.

 @return CTC_E_XXX
*/
extern int32
ctc_asw_vlan_add_vlan_range(uint8 lchip, ctc_vlan_range_info_t* vrange_info, ctc_vlan_range_t* vlan_range);

/**
 @brief  Remove a vlan range member to a vrange_group

 @param[in] lchip    local chip id

 @param[in] vrange_info   vlan range info

 @param[in] vlan_range    vlan_start and vlan_end in vlan range

 @remark[TMA]
      Remove vlan range entry from vlan range group, according to vrange_grpid & direction of the vlan range group.
      Note: vlan range group must be create and this vlan range entry must be added before, or will reply error.

 @return CTC_E_XXX
*/
extern int32
ctc_asw_vlan_remove_vlan_range(uint8 lchip, ctc_vlan_range_info_t* vrange_info, ctc_vlan_range_t* vlan_range);

/**
 @brief  Get all vlan range members from a vlan range

 @param[in] lchip    local chip id

 @param[in]  vrange_info   vlan range info

 @param[out] vrange_group    all vlan_start vlan_end in a group

 @param[out] count      valid range count

 @remark[TMA]
      Get info about vlan range entries and count in the vlan range group,according to vrange_grpid & direction

 @return CTC_E_XXX
*/
extern int32
ctc_asw_vlan_get_vlan_range(uint8 lchip, ctc_vlan_range_info_t* vrange_info, ctc_vlan_range_group_t* vrange_group, uint8* count);
/**
 @addtogroup VlanClassification VlanClassification
 @{
*/

/**
 @brief  Add one vlan classification rule

 @param[in] lchip    local chip id

 @param[in] p_vlan_class    Vlan classification info, include key and policy

 @remark[TMA]
     Add an association from MAC, IPV4 subnet, IPV6 subnet, POLICY or PROTOCOL to use for assigning a vlan tag to untag or priority packet.
     Type in p_vlan_class will be the mode of vlan class:
     \p
     1. Vlan class by policy(packet feature) according to :
     \pp
     (1) Flex_ipv4:ipv4sa|ipv4da|macsa|macda|l3-type|l4-type|l4-src-port|l4-dest-port
     \pp
     (2) Flex_ipv6:ipv6sa|ipv6da|macsa|macda|l4-type|l4-src-port|l4-dest-port
     if policy used, set flag CTC_VLAN_CLASS_FLAG_USE_FLEX.
     \p
     2. Vlan class by mac according to :
     \pp
     Mac:macsa or macda (if macda, set flag CTC_VLAN_CLASS_FLAG_USE_MACDA)
     \p
     3. Vlan class by ip according to :
     \pp
     (1) Ipv4:ipv4_sa
     \pp
     (2) Ipv6:ipv6_sa
     \p
     4. Vlan class by protocol according to :
     \pp
     Ether-type: the ether type is a 16-bit value that matches the ethertype field in the received packet.
     \p
     \b
     Further more, PRI: mac/ipv4/ipv6/policy > protocol > port(default).
     You can configure vlan_id as the new vlan id. If output new cos, flag CTC_VLAN_CLASS_FLAG_OUTPUT_COS must be set.
     Enable the function on port by API ctc_port_set_scl_property() with key type relative, tcam default entry should use class id 62.

 @return CTC_E_XXX
*/
extern int32
ctc_asw_vlan_add_vlan_class(uint8 lchip, ctc_vlan_class_t* p_vlan_class);

/**
 @brief Remove on vlan classification rule

 @param[in] lchip    local chip id

 @param[in] p_vlan_class    Vlan classification info, include key and policy

 @remark[TMA]
     Remove an association from MAC, IPV4 subnet, IPV6 subnet, POLICY or PROTOCOL to vlan.
     Type in p_vlan_class will be the mode of vlan class:
     \p
     1. Vlan class by policy(packet feature) according to :
     \pp
     (1) Flex_ipv4:ipv4sa|ipv4da|macsa|macda|l3-type|l4-type|l4-src-port|l4-dest-port
     \pp
     (2) Flex_ipv6:ipv6sa|ipv6da|macsa|macda|l4-type|l4-src-port|l4-dest-port
     if policy used, set flag CTC_VLAN_CLASS_FLAG_USE_FLEX.
     \p
     2. Vlan class by mac according to :
     \pp
     Mac:macsa or macda (if macda, set flag CTC_VLAN_CLASS_FLAG_USE_MACDA)
     \p
     3. Vlan class by ip according to :
     \pp
     (1) Ipv4:ipv4_sa
     \pp
     (2) Ipv6:ipv6_sa
     \p
     4. Vlan class by protocol according to :
     \pp
     Ether-type: the ether type is a 16-bit value that matches the ethertype field in the received packet.
     \p
     Disable the function on port by API ctc_port_set_scl_property() with key type relative.

 @return CTC_E_XXX
*/
extern int32
ctc_asw_vlan_remove_vlan_class(uint8 lchip, ctc_vlan_class_t* p_vlan_class);
/**@} end of @addtogroup VlanClassification*/

INTERNAL extern int32
_ctc_asw_vlan_set_internal_property(uint8 lchip, uint16 vlan_id, ctc_asw_vlan_property_t vlan_prop, uint32 value);

INTERNAL extern int32
_ctc_asw_vlan_get_internal_property(uint8 lchip, uint16 vlan_id, ctc_asw_vlan_property_t vlan_prop, uint32* value);

INTERNAL extern int32
_ctc_asw_vlan_get_internal_range_type(uint8 lchip, ctc_vlan_range_info_t* vrange_info, bool* is_svlan);

#ifdef __cplusplus
}
#endif

#endif
